﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using WL_Store.BLL;
using WL_Store.Model;
using WL_Store.Web.subpage;

namespace WL_Store.Web
{
    public partial class Index : BasePage
    {
        public EmployeeInfoModel myInfo = new EmployeeInfoModel();
        protected void Page_Load(object sender, EventArgs e)
        {
            EmployeeInfoModel model = new EmployeeInfoModel();
            model = Session["EmployeeInfo"] as EmployeeInfoModel;

            if (model != null)
            {
                myInfo = model;
            }
        }

        protected void lbt_Exit_system_Click(object sender, EventArgs e)
        {
            //ScriptManager.RegisterStartupScript(this.lbt_Exit_system, this.GetType(), "alter", "ExitAlter();", true);
           //Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "<script>window.onload=function(){ExitAlter();}</script>");
           
        }

        [WebMethod]
        public static void ExitAlter()
        {
            LoginLogsBLL bll = new LoginLogsBLL();

            int LogIdIdent = Convert.ToInt32(bll.GetIdentity());

            bll.UpdateExitTime(LogIdIdent, DateTime.Now);
        }



    }
}